package com.ivi.car.common;

import android.app.Application;

import com.ivi.car.utils.net.api.NetService;
import com.squareup.leakcanary.LeakCanary;
import com.wm.machine.baselibrary.utils.AppUtils;
import com.wm.machine.baselibrary.utils.imageutils.CustomCachingGlideModule;
import com.wm.machine.baselibrary.utils.imageutils.glide.ImageLoader;
import com.wm.machine.baselibrary.utils.net.core.NetGlobalConfig;

/**
 * Created by zhaolong.han on 2018/3/7.
 */

public class MyApplication extends Application {
    private static MyApplication mInstance;


    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        AppUtils.init(this);
        if (LeakCanary.isInAnalyzerProcess(this)) {
            // This process is dedicated to LeakCanary for heap analysis.
            // You should not init your app in this process.
            return;
        }
        LeakCanary.install(this);
        ImageLoader.init(getApplicationContext());
        //设置网路访问的默认baseUrl 和 网络请求api
        NetGlobalConfig.setNetServiceClass(NetService.class)
                .setBaseUrl(NetService.baseUrl)
                .init(this);
    }

    public static MyApplication getInstance() {
        return mInstance;
    }
}
